package comp418.blingo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import comp418.blingo.language.bt_profile;

public class userprofile extends Activity {
	private Utility utility=null;
	private Button bt_update=null;
	private Button bt_test=null;
	private TextView username=null;
	private EditText password=null;
	private EditText email=null;
	private TextView coin=null;
	private TextView translator=null;
	
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.userprofile);
		utility=Utility.getUtility();
		//TODO update the info
		
		bt_update = (Button) findViewById(R.id.updateaccount);
		bt_test = (Button) findViewById(R.id.test);
		username = (TextView) findViewById(R.id.username_show);
		coin = (TextView) findViewById(R.id.bcoin_show);
		translator = (TextView) findViewById(R.id.translator_show);
		password = (EditText) findViewById(R.id.password_show);
		email = (EditText) findViewById(R.id.email_show);
		bt_update.setOnClickListener(new bt_up());
		bt_test.setOnClickListener(new bt_testing());
		translator.setText("Yes");
		int cnumber=-1;
		cnumber=utility.getProfile(utility.getUsername());
		
		coin.setText(new Integer(cnumber).toString());
		username.setText(utility.getUsername());
		
	}
	
	class bt_up implements android.view.View.OnClickListener {

		public void onClick(View v) {
			// TODO Auto-generated method stub
			int cnumber=-1;
			cnumber=utility.getProfile(utility.getUsername());
			coin.setText(new Integer(cnumber).toString());
			username.setText(utility.getUsername());
			
		}
	}
	
	class bt_testing implements android.view.View.OnClickListener {

		public void onClick(View v) {
			// TODO Auto-generated method stub

			Intent intent=new Intent();
			String user=utility.getUsername();
			intent.putExtra("username", user);
			

		}
	}
	
}
